<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .grid-container {
            display: grid;

            /* 网格划分 */
            grid-template-rows: 100px 1fr 50px;
            grid-template-columns: 1fr 2fr 1fr;
            /* 指定区域（area） */
            grid-template-areas:
                'header header header'
                'sidebar main main'
                'footer footer footer';
            gap: 10px;
        }

        .header {
            grid-area: header;
            background-color: pink;
        }

        .sidebar {
            grid-area: sidebar;
            background-color: palegoldenrod;
        }

        .main {
            grid-area: main;
            background-color: palegreen;
        }

        .footer {
            grid-area: footer;
            background-color: paleturquoise;
        }
    </style>
</head>

<body>
    <div class="grid-container">
        <div class="header">header</div>
        <div class="sidebar">sidebar</div>
        <div class="main">main</div>
        <div class="footer">footer</div>
    </div>
</body>

</html>